<div class="row">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id' => 'menu-_form-form',
	'enableAjaxValidation' => true,
    'enableClientValidation' => true,
    'clientOptions' => array(  
        'validateOnSubmit' => true, 
     ),
    'htmlOptions' => array(
        'autocomplete' => 'off',
    )
)); ?>
<table class="table table-bordered table-hover definewidth">
    <tr>
        <td width="10%" class="tableleft"><?php echo $form->labelEx($model, 'fid'); ?></td>
        <td>
        <?php //if($model->isNewRecord){?>
        <select name="AdminMenu[fid]">
        <option value="0">顶级菜单</option>
        <?php 
        $menuData = AdminMenu::getMenuData($this->module->id);
        $tree = new Tree($menuData);
        $tree->icon = array('&nbsp;│ ','&nbsp;├─ ','&nbsp;└─ ');
        $tree->nbsp = '&nbsp;';
        $str="<option value='\$id' \$selected>\$spacer\$menu_name</option>";
        $categorys = $tree->get_tree(0, $str, $fid);
        echo $categorys;
        ?>
        </select>
        <?php //}else{?>
        <?php //echo $model->fid==0?'顶级菜单':$model->parent->menu_name;?>
        <?php //}?>
    	<?php echo $form->error($model, 'fid'); ?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft"><?php echo $form->labelEx($model, 'menu_name'); ?></td>
        <td>
        <?php echo $form->textField($model,'menu_name'); ?>
    	<?php echo $form->error($model, 'menu_name'); ?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft"><?php echo $form->labelEx($model, 'module_id'); ?></td>
        <td>
        <?php echo $form->textField($model,'module_id'); ?>
    	<?php echo $form->error($model, 'module_id'); ?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft"><?php echo $form->labelEx($model, 'controller_id'); ?></td>
        <td>
        <?php echo $form->textField($model,'controller_id'); ?>
    	<?php echo $form->error($model, 'controller_id'); ?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft"><?php echo $form->labelEx($model, 'action_id'); ?></td>
        <td>
        <?php echo $form->textField($model,'action_id'); ?>
    	<?php echo $form->error($model, 'action_id'); ?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft"><?php echo $form->labelEx($model, 'display'); ?></td>
        <td>
        <?php echo $form->radioButtonList($model,'display',array('0'=>'否','1'=>'是'),array('separator'=>'&nbsp;')); ?>
    	<?php echo $form->error($model, 'display'); ?>
        </td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
        	<?php echo CHtml::submitButton('保存',array('class'=>'button button-primary'));?>
            <?php echo CHtml::link('返回列表',$this->createUrl('menu/index'),array('class'=>'button button-success'));?>
        </td>
    </tr>
</table>
<?php $this->endWidget(); ?>
</div>